<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Gestion des stocks - Liste des produits</title>
		<link type="text/css" media="screen" rel="stylesheet" href="/GestionStock//ressources/css/Default.css" />
		<script type="text/javascript" src="/GestionStock/ressources/js/jquery-1.6.4.min.js"></script>
		<script type="text/javascript" src="/GestionStock/ressources/js/liste.js"></script>
	</head>
	<body>
		
	<div id="header">
			<div id="banner"></div>
			<h1>Gestion des stocks</h1>
		</div>
		
		<div id="content">
			<div id="nav">
				<s:a href="gotoListe.action">Liste</s:a>
				<s:a href="gotoAjouterProduit.action">Ajouter</s:a>
				<s:if test="#session.loggedin == true">
                    <a href="logout.action">Déconnexion</a>
				</s:if>
			</div>
			
			<div id="bodyContent" class="listeProduits">
				<div id="searchBar">
					<label for="s_codePdt">Code produit</label><input type="text" id="s_codePdt" />
					<label for="s_nomPdt">Nom produit</label><input type="text" id="s_nomPdt" />
					<button class="button" id="valider_search_liste">Filtrer</button>
				</div>
								
				<table id="listePdts">
					<thead>
						<tr>
							<th>id</th>
							<th>Code produit</th>
							<th>Nom produit</th>
							<th>Unité</th>
							<th>Prix</th>
							<th>Device</th>
							<th>&nbsp;</th>
							<th>&nbsp;</th>
						</tr>
					</thead>
					
					<tbody>
					
						<s:if test="listProducts.size()>0">
							<s:iterator value="listProducts">
								<tr class="color1">
									<td><s:property value="id" /></td>
									<td><s:property value="produitCode" /></td>
									<td><s:property value="libelle" /></td>
									<td><s:property value="unite.unit" /></td>
									<td><s:property value="prix" /></td>
									<td><s:property value="devise.currency" /></td>
									<td><img src="/ressources/img/edit.png" alt="Modifier" /></td>
									<td><img src="/ressources/img/delete.gif" alt="Supprimer" /></td>
								</tr>
							</s:iterator>
						</s:if>
				
					</tbody>
				</table>
				
				
				
			</div>
		</div>
		
		<div id="footer">
			
		</div>
		
	</body>
</html>